package com.aizuda.boot.modules.common.constant.enums;

/**
 * 权限操作类型枚举
 * 
 * @author system
 * @version 1.0
 * @date 2025/1/27
 */
public enum PermissionActionType {

    TEMPLATE("template", "合同模板管理"),
    BATCH_DOWNLOAD("batchDownload", "批量下载"),
    HANDOVER("handover", "交接合同"),
    EFFICIENCY("efficiency", "效事看板"),
    CHANGE_AGENT("changeAgent", "变更合同经办人"),
    WORKFLOW("workflow", "审批流程管理"),
    MAINTAIN("maintain", "维护关联合同"),
    EDIT_ARCHIVE_NO("editArchiveNo", "修改归档编号"),
    IMPORT_HISTORY("importHistory", "导入历史合同"),
    SYSTEM("system", "系统管理"),
    PARTNER("partner", "交易方管理"),
    CHANGE_SCOPE("changeScope", "可变更的合同范围"),
    DOWNLOAD_SCOPE("downloadScope", "可下载的合同范围"),
    SHARE("share", "分享合同"),
    EXPORT("export", "导出合同"),
    DASHBOARD("dashboard", "效事看板"),
    DOWNLOAD_ARCHIVE("downloadArchive", "下载归档文件"),
    UPLOAD_DELETE_ARCHIVE("uploadDeleteArchive", "在合同详情页上传&删除归档文件"),
    CONTRACT("contract", "合同模板管理")
    ;

    private final String code;
    private final String description;

    PermissionActionType(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    /**
     * 根据code获取枚举
     */
    public static PermissionActionType getByCode(String code) {
        for (PermissionActionType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
} 